home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: making #define's to be seen across files
- Date: 9 Apr 1996 11:58 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <9APR199611584596@erich.triumf.ca>
- References: <1996Apr9.164443.28709@relay.nswc.navy.mil>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <1996Apr9.164443.28709@relay.nswc.navy.mil>, dheffel@vitds2.nswc.navy.mil writes...
- >Hi there,
- > There is (hopefully) a simple answer to my question:
- >
- >I have some C code divided into different source files.
- >When I try to compile using
- > "cc file1.c file2.c file3.c"
- >the constants #define'd in file1.c are not visible in file2.c, is there a
- >way to make them visible to the other source files? In other words, is
- >there som equivalent to "extern" for constants?
-
- Put anything you want known to multiple files in a .h file that you #include
- in each .c file (actually, you don't _have_ to call the #included file
- something.h, but it is traditional...)
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-
-
-
-
-